package com.springboot.rookie.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.springboot.rookie.pojo.SysUserBean;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Options;

public interface SysUserMapper extends BaseMapper<SysUserBean> {

    SysUserBean getUserByName(String name);

    /*配置文件方式*/
    void saveUser(SysUserBean info);

    /*注解方式*/
    @Insert("insert into sys_user(dept_id, user_name, password, nick_name, phone, sex, email, avatar) values(#{deptId},#{userName},#{password},#{nickName},#{phone},#{sex},#{email},#{avatar})")
    @Options(useGeneratedKeys = true, keyProperty = "userId")
    void insertUser(SysUserBean info);
}
